﻿#ifndef CHECKTHREAD_H
#define CHECKTHREAD_H

#include <QThread>
#include "public.h"

class CheckThread : public QThread
{
    Q_OBJECT

public:

    CheckThread(QObject *parent = 0);

    void SetFilePath(QString strFilePath);
    TFileInfo GetFileInfo() { return m_tFileInfo; }

    void stop();

    void onProgress(char *filepath, uint8_t dwProgress);
    static void cbParsingProgress(char *filepath, uint8_t dwProgress, void *pContent);

protected:
    //QThread的虚函数
    //线程处理函数
    //不能直接调用，通过start()间接调用
    void run();

signals:
    void SignalProgress(ECheckStep eStep, int nProgress);
    void SignalFinish(bool bSuc, QString strMd5);

private:
    QString m_strFilePath;
    bool m_bStart;
    ECheckStep m_eStep;
    TFileInfo m_tFileInfo;
};

#endif // CHECKTHREAD_H
